package com.richard.mine.model.repository

import com.richard.base.net.bean.KsResult
import com.richard.mine.model.api.MineService
import com.richard.mine.model.bean.MyTeacherBean
import com.richard.base.net.model.repository.KsBaseRepository

/**
 ***************************************
 * 项目名称:base
 * @Author jiaruihua
 * 邮箱：jiaruihua@ksjgs.com
 * 创建时间: 2020-02-27     10:14
 * 用途:
 ***************************************
 */

class MineRepositoryImpl : MineRepository, KsBaseRepository() {
    /**
     * 获取老师详情
     */
    override suspend fun getMyTeacher(): KsResult<MutableList<MyTeacherBean>> {
        return safeApiCall(call = { requestMyTeacher(mutableMapOf()) })
    }

    private suspend fun requestMyTeacher(params: MutableMap<String, Any>): KsResult<MutableList<MyTeacherBean>> {
      return  executeResponse(getService(MineService::class.java).getMyTeacher(params))

//        var teachers = mutableListOf<MyTeacherBean>()
//
//        repeat(3) {
//            teachers.add(MyTeacherBean(System.currentTimeMillis() + it, "",
//                    "凯叔语文启蒙年课年课$it", "http://b-ssl.duitang.com/uploads/item/201703/26/20170326161532_aGteC.jpeg",
//                    "", "", "朱朱老师$it", " $it 潍坊医学院心理学系副主任，教授，硕士生,导师，硕士生,导师硕士生,导师硕士生,导师硕士生,导师硕士生,导师中国科学院心理研究所博士。",
//                    it.toLong(), "aaaaa$it"))
//        }
//        return KsResult.Success(teachers, 0, "")
    }
}